# 作者: 家里蹲 吴越洋
# 2023年03月03日09时16分29秒
from operator import itemgetter
student_objects = [
    ('john', 'A', 15),
    ('jane', 'B', 12),
    ('dave', 'B', 10),
    ]

student1={"wang":[100,120,87,90],
          "zhang":[99,120,80,90],
          "li":[90,120,80,80],
          "zhao":[80,70,90,99]}

if __name__ == '__main__':
    for i in student_objects:
        print(i,end=' ')
    print('\n',sorted(student_objects,key=lambda student:student[0]))
    print(sorted(student_objects,key=itemgetter(1)))
    for i in student1:
        print(i,end=' ')
    print('\n')  #上面的i即下面lamaba表达式中排序的依据
    print(sorted(student1,key=lambda student:student[0]))
    print('*'*50)
    for i in student1.items():
        print(i,end=' ')
    print('\n')  #上面的i以键值对的形式为下面lamaba表达式中排序的依据
    print(sorted(student1.items(),key=lambda student:student[1][2]))
    #  有student1.items()  则student[1]表示元组后面的一个列表  student[1][2]以列表中第三个元素为依据排序